$(function () {
    let FullReductionList = [
        { activityName: "新用户满减", rules: "满100减20", state: "进行中", StartTime: "2019-05-20 20:20", endTime: "2019-06-30 20:20" },
        { activityName: "天天神减", rules: "满100减10", state: "进行中", StartTime: "2020-03-10 10:10", endTime: "2020-03-11 10:10" },
        { activityName: "浪漫七夕满减", rules: "满1314减520", state: "进行中", StartTime: "2022-08-04 08:00", endTime: "2022-08-04 00:00" },
        { activityName: "美食满减", rules: "满50减18", state: "结束", StartTime: "2022-08-01 12:01", endTime: "2022-08-03 12:01" },
        { activityName: "天天特价", rules: "满114减32", state: "进行中", StartTime: "2022-08-02 09:00", endTime: "2022-08-04 09:00" },
        { activityName: "回头客满减券", rules: "满100减25", state: "进行中", StartTime: "2022-04-01 15:34", endTime: "2022-08-09 15:34" },
        { activityName: "直播满减劵", rules: "满300减100", state: "进行中", StartTime: "2020-12-02 13:20", endTime: "2022-12-02 13:20" },
        { activityName: "分享二维码满减券", rules: "满110减20", state: "结束", StartTime: "2019-05-20 20:20", endTime: "2019-06-30 20:20" },
        { activityName: "双十一开门满减", rules: "满100减50", state: "结束", StartTime: "2019-11-11 00:00", endTime: "2019-11-12 00:00" },
        { activityName: "双十二开门满减", rules: "满100减50", state: "结束", StartTime: "2019-12-12 00:00", endTime: "2019-12-13 00:00" },
        { activityName: "小趴菜欢迎券", rules: "满600减150", state: "进行中", StartTime: "2022-05-02 10:40", endTime: "2022-09-02 10:40" },
        { activityName: "彩虹屁夸我满减", rules: "满1000减500", state: "进行中", StartTime: "2022-02-22 22:22", endTime: "2022-07-17 17:17" },
        { activityName: "新品优惠券", rules: "满1100减220", state: "进行中", StartTime: "2019-05-20 20:20", endTime: "2022-12-20 10:10" },
        { activityName: "帅哥全减", rules: "满100减100", state: "结束", StartTime: "2022-05-20 20:20", endTime: "2019-06-30 20:20" },
        { activityName: "美女全减", rules: "满100减100", state: "结束", StartTime: "2022-05-20 20:20", endTime: "2019-06-30 20:20" },
        { activityName: "不知道减好多", rules: "满1999减999", state: "进行中", StartTime: "2022-07-09 09:09", endTime: "2022-09-09 09:09" }
    ]


    // 用全部数据渲染页面
    function render(data) {
        // 显示有多少条数据
        $("#disData").text(FullReductionList.length);
        // 渲染数据
        $("#fullReductionData").html("");
        for (let i = 0; i < data.length; i++) {
            $('#fullReductionData').append(`<tr id='selectedInformation'>
                <td>${data[i].activityName}</td>
                <td>${data[i].rules}</td>
                <td>${data[i].state}</td>
                <td>${data[i].StartTime}</td>
                <td>${data[i].endTime}</td>
                <td>
                <button data-id = ${i} id = 'edit' class="btn btn-info font" data-toggle="modal" data-target="#myModal">编辑
                </button>
                <button data-id = ${i} id='del' class="btn btn-info font" data-toggle="modal" data-target="#myDel">删除
                </button>
                </td>
            </tr>`)
        }
    }
    // render(FullReductionList)

    // 来分割数据然后渲染到页面
    function InterceptData(pageOne, data) {
        let StartPosition = (pageOne - 1) * 6;
        let EndPosition = StartPosition + 6
        let groupThree = data.slice(StartPosition, EndPosition);
        render(groupThree);
    }
    InterceptData(1, FullReductionList)


    //数据分页制作页数
    function pageNumber(data) {
        let pageNum = Math.ceil(data.length / 6); //计算有好多页数
        $("#pageNumber").html("")
        for (let i = 1; i <= pageNum; i++) { //循环写入数据
            $("#pageNumber").append(`
                    <div data-id = ${i} class="styPage">${i}</div>
                `)
        }
    }
    pageNumber(FullReductionList)

    // 点击页码显示每页的信息
    let pageId = 1;
    function clickPageNumber(pageId, data) {
        $("#pageNumber").children().eq(0).css("backgroundColor", "#ffff")
        $('#pageNumber').on('click', '.styPage', function () {
            pageId = $(this).attr('data-id');
            console.log(pageId);
            $(this).css("backgroundColor", "#ffff").siblings().css("backgroundColor", "#ede9e9")
            InterceptData(pageId, data)
        })
        pageId = $(this).attr('data-id');
    }
    clickPageNumber(pageId, FullReductionList)

    // 点击上一页和下一页显示相应页码的数据，页码也跟着变化
    function handoff(pageId, data) {
        // pageId = 1;
        $('.pagination').find("li").eq(0).click(function () {
            if (pageId > 1) {
                pageId--;
                $(".pageBox").children().eq(pageId - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptData(pageId, data)
            } else {
                pageId = $(".pageBox").children().length;
                $(".pageBox").children().eq(pageId - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptData(pageId, data)
            }
        })
        $('.pagination').find("li").eq(1).click(function () {
            // console.log(pageId);
            if (pageId < $(".pageBox").children().length) {
                pageId++;
                $(".pageBox").children().eq(pageId - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptData(pageId, data)
            } else {
                pageId = 1;
                $(".pageBox").children().eq(pageId - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptData(pageId, data)
            }
        })
    }
    handoff(pageId, FullReductionList)

    // // 在class="jumpPage"下面的input中输入数字，页面跳转到第n页
    function jumpPageNumber() {
        $(".okJump").click(function () {
            let inPage = parseInt($("#inPage").val());
            console.log(inPage);
            let pageNum = Math.ceil(FullReductionList.length / 6); //计算有好多页数
            if (inPage >= 1 && inPage <= pageNum) {
                InterceptData(inPage, FullReductionList)
                handoff(inPage, FullReductionList)
                $("#pageNumber").children().eq(inPage - 1).css("backgroundColor", "#f4f4f4").siblings().css("backgroundColor", "#ffff")
            }
        })

    }
    jumpPageNumber()

    // 点击删除按钮，删除该信息
    $(".modalDel").hide()
    function delInformation() {
        $("#fullReductionData").on('click', '#del', function () {
            $(".modalDel").show()
            let aa = $(this).parents("tr").children().eq(0).text();
            $('#yesDel').click(function () {
                for (let i = 0; i < FullReductionList.length; i++) {
                    if (FullReductionList[i].activityName == aa) {
                        FullReductionList.splice(i, 1)
                    }
                }
                InterceptData(1, FullReductionList)
                pageNumber(FullReductionList)
                $(".modalDel").hide()
            })
            $("#noDel").click(function () {
                $(".modalDel").hide()
            })
        })
    }
    delInformation()

    //点击编辑，编辑信息
    $("#editBox").hide();
    function getInformation() {
        $("#fullReductionData").on('click', '#edit', function () {
            $("#editBox").show();
            $("#homeBox").hide();
            let Info1 = $(this).parents('tr').children().eq(0).text();
            let Info2 = $(this).parents('tr').children().eq(1).text();
            // console.log(Info1);
            let ina = Info2.split("减") //减
            let inb = ina[0].split("满") //满

            $("#editName").val(Info1);
            $("#editAllMoney").val(inb[1]);
            $("#editSubtractMoney").val(ina[1]);

            $("#editSave").click(function () {
                let acName = $("#editName").val();
                console.log(acName);
                let allMoney = $("#editAllMoney").val();
                let subtractMoney = $("#editSubtractMoney").val();
                let activityTime = $("#editActivityTime").val();
                let endTime = $("#editEndTime").val();

                let time1 = new Date();//获取系统当前时间
                let s = time1.getSeconds();
                let timeS = time1.getTime();
                let myTime = timeS - s * 1000;

                let a = new Date($("#editEndTime").val())  //获取输入的时间
                let allTime = a.getTime()

                activityTime = activityTime.replace("T", " ");
                endTime = endTime.replace("T", " ");
                for (let i = 0; i < FullReductionList.length; i++) {
                    if (FullReductionList[i].activityName == Info1) {
                        FullReductionList[i].activityName = acName;
                        FullReductionList[i].rules = '满' + allMoney + '减' + subtractMoney;
                        FullReductionList[i].StartTime = activityTime;
                        FullReductionList[i].endTime = endTime;
                        if (allTime <= myTime) {
                            FullReductionList[i].state = "结束";
                            InterceptData(1, FullReductionList)
                        } else {
                            FullReductionList[i].state = "进行中";
                            InterceptData(1, FullReductionList)
                        }

                    }
                }
                $("#editBox").hide();
                $("#homeBox").show();
            })
            $("#editCancel").click(function () {
                $("#editBox").hide();
                $("#homeBox").show();
            })
        })
    }
    getInformation()

    // 添加满减
    $("#noneBox").hide()
    // $("#noneBox").show()
    // $("#homeBox").hide();
    $("#addFullReduction").click(function () {
        $("#noneBox").show();
        $("#homeBox").hide();
        let newFullReduction
        $("#save").click(function () {
            let acName = $("#acName").val();
            let allMoney = $("#allMoney").val();
            let subtractMoney = $("#subtractMoney").val();
            let activityTime = $("#activityTime").val();
            let endTime = $("#endTime").val();

            let time1 = new Date();//获取系统当前时间
            let s = time1.getSeconds();
            let timeS = time1.getTime();
            let myTime = timeS - s * 1000;

            let a = new Date($("#endTime").val())  //获取输入的时间
            let allTime = a.getTime()

            activityTime = activityTime.replace("T", " ")
            endTime = endTime.replace("T", " ")
            if (acName != "" && allMoney != "" && subtractMoney != "" && activityTime != "" && endTime != "") {
                if (allTime <= myTime) {
                    newFullReduction = {
                        "activityName": acName,
                        "rules": '满' + allMoney + '减' + subtractMoney,
                        "state": "结束",
                        "StartTime": activityTime,
                        "endTime": endTime
                    }
                    FullReductionList.push(newFullReduction)
                } else {
                    newFullReduction = {
                        "activityName": acName,
                        "rules": '满' + allMoney + '减' + subtractMoney,
                        "state": "进行中",
                        "StartTime": activityTime,
                        "endTime": endTime
                    }
                    FullReductionList.push(newFullReduction)
                }


            }
            $("#noneBox").hide();
            $("#homeBox").show();
        })
        $("#cancel").click(function () {
            $("#noneBox").hide();
            $("#homeBox").show();
        })
    })

    // 查询满减信息
    function queryInformation() {
        $('#okSearch').click(function () {
            let queryNewList = [...FullReductionList];
            let activityName = ($('#activityName').val());
            let activitySate = ($('#activitySate option:selected').val());
            let queryArTime = ($('#queryArTime').val());
            let queryEnTime = ($('#queryEnTime').val());
            queryArTime = queryArTime.replace("T", " ")
            queryEnTime = queryEnTime.replace("T", " ")
            console.log(queryArTime);
            console.log(queryNewList[2].StartTime);
            if (activityName != "") {
                for (let i = 0; i < queryNewList.length; i++) {
                    if (queryNewList[i].activityName != activityName) {
                        queryNewList.splice(i, 1)
                        i--
                    }
                }
            }
            if (activitySate != "change") {
                for (let i = 0; i < queryNewList.length; i++) {
                    if (queryNewList[i].state != activitySate) {
                        queryNewList.splice(i, 1)
                        i--
                    }
                }
            }
            if (queryArTime != 0) {
                for (let i = 0; i < queryNewList.length; i++) {
                    if (queryNewList[i].StartTime != queryArTime) {
                        queryNewList.splice(i, 1)
                        i--
                    }
                }
            }
            if (queryEnTime != "") {
                for (let i = 0; i < queryNewList.length; i++) {
                    if (queryNewList[i].endTime != queryEnTime) {
                        queryNewList.splice(i, 1)
                        i--
                    }
                }
            }
            let newPageId
            function pageOut1() {
                newPageId = $(this).attr('data-id')
                $('#pageNumber').on('click', '.styPage', function () {
                    newPageId = $(this).attr('data-id')
                    $(this).css("backgroundColor", "#f4f4f4").siblings().css("backgroundColor", "#ffff")
                    InterceptData(newPageId, queryNewList)
                })
                newPageId = $(this).attr('data-id')
            }
            pageOut1()
            InterceptData(1, queryNewList)
            clickPageNumber(newPageId, queryNewList)
            pageNumber(queryNewList)
            $("#pageNumber").children().eq(0).css("backgroundColor", "#f4f4f4")
            $('#activityName').val("")
            $('#activitySate').val("change")
            $('#queryArTime').val("")
            $('#queryEnTime').val("")
        })
    }
    queryInformation()

    // 点击返回按钮回到初始页面
    function resetDataClass() {
        $('#noSearch').click(function () {
            InterceptData(1, FullReductionList)
            pageNumber(FullReductionList)
        })

    }
    resetDataClass()


    // 添加商品的数据
    let commodity = [
        { "ProductIn": "鸿星尔克夏季跑步鞋", "brand": "鸿星尔克", "Price": 320.00, "classify": "鞋", "Shelves": "是" },
        { "ProductIn": "李宁夏季跑步鞋", "brand": "李宁", "Price": 520.00, "classify": "夏季", "Shelves": "是" },
        { "ProductIn": "乔丹篮球鞋", "brand": "乔丹", "Price": 1777.00, "classify": "定制", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "否" },
        { "ProductIn": "xxxxxxxxx", "brand": "xx", "Price": 100.00, "classify": "xxx", "Shelves": "是" }
    ]
    // 添加货品
    // $(".modalItem").show()
    function addItem() {
        $(".modalItem").hide()
        $("#SelectItem").click(function () {
            $(".modalItem").show()
            $("#quitItem").click(function () {
                $(".modalItem").hide()
            })
        })
    }
    addItem()

    // 把商品信息渲染到页面
    function renderCommodity(data) {
        // 渲染数据
        $("#commodity_In").html("");
        for (let i = 0; i < data.length; i++) {
            $('#commodity_In').append(`<tr>
                <td><input type="checkbox"></td>
                <td>${data[i].ProductIn}</td>
                <td>${data[i].brand}</td>
                <td>${data[i].Price}</td>
                <td>${data[i].classify}</td>
                <td>${data[i].Shelves}</td>
            </tr>`)
        }
    }
    renderCommodity(commodity)

    // 来分割数据然后渲染到页面
    function InterceptCommodity(pageOne, data) {
        let StartPosition = (pageOne - 1) * 4;
        let EndPosition = StartPosition + 4
        let groupThree1 = data.slice(StartPosition, EndPosition);
        renderCommodity(groupThree1)
    }
    InterceptCommodity(1, commodity)
    //商品数据分页制作页数
    function pageNumber_com(data) {
        let pageNum = Math.ceil(data.length / 4); //计算有好多页数
        $("#commodity_page").html("")
        for (let i = 1; i <= pageNum; i++) { //循环写入数据
            $("#commodity_page").append(`
                    <div data-id1 = ${i} class="styPage">${i}</div>
                `)
        }
    }
    pageNumber_com(commodity)

    // 商品数据点击页码显示每页的信息
    let pageId_cm = 1;
    function clickPageNumber1(pageId_cm, data) {
        $("#commodity_page").children().eq(0).css("backgroundColor", "#ffff")
        $('#commodity_page').on('click', '.styPage', function () {
            pageId_cm = $(this).attr('data-id1');
            $(this).css("backgroundColor", "#ffff").siblings().css("backgroundColor", "#ede9e9")
            InterceptCommodity(pageId_cm, data)
        })
        pageId_cm = $(this).attr('data-id1');
    }
    clickPageNumber1(pageId_cm, commodity)

    // 点击上一页和下一页显示相应页码的数据，页码也跟着变化
    function handoff_com(pageId_cm, data) {
        // pageId = 1;
        $('#previous').click(function () {
            if (pageId_cm > 1) {
                pageId_cm--;
                $("#commodity_page").children().eq(pageId_cm - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptCommodity(pageId_cm, data)
            } else {
                pageId_cm = $("#commodity_page").children().length;
                $("#commodity_page").children().eq(pageId_cm - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptCommodity(pageId_cm, data)
            }
        })
        $('#next').click(function () {
            if (pageId_cm < $("#commodity_page").children().length) {
                pageId_cm++;
                $("#commodity_page").children().eq(pageId_cm - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptCommodity(pageId_cm, data)
            } else {
                pageId_cm = 1;
                $("#commodity_page").children().eq(pageId_cm - 1).css("backgroundColor", '#ffff').siblings().css("backgroundColor", "#ede9e9")
                InterceptCommodity(pageId_cm, data)
            }
        })
    }
    handoff_com(pageId_cm, commodity)

    // 点击选择按钮
    let commodity_ch_List = new Array();//保存选中的商品信息
    function choose() {
        // 全选所有
        let agin = false
        let cont = 0
        $("#SelectAll").click(function () {
            // 全选本页
            if (agin == false) {
                $("#SelectAllBox").prop("checked", true);
                $("#commodity_In").find("input").prop("checked", true);
                agin = true;
                cont = $("#commodity_In").children().length
                $("#number_com").text(cont)
                for (let i = 0; i < $("#commodity_In").children().length; i++) {
                    commodity_ch_List.push(commodity[i])
                }
            } else {
                $("#SelectAllBox").prop("checked", false);
                $("#commodity_In").find("input").prop("checked", false);
                agin = false;
                cont = 0
                $("#number_com").text(cont)
                commodity_ch_List = [];
            }
            addCommodity(commodity_ch_List);
        })
        $("#SelectAllBox").click(function () {
            // 全选本页
            if (agin == false) {
                $("#SelectAllBox").prop("checked", true);
                $("#commodity_In").find("input").prop("checked", true);
                agin = true;
                cont = $("#commodity_In").children().length
                $("#number_com").text(cont)
                for (let i = 0; i < $("#commodity_In").children().length; i++) {
                    commodity_ch_List.push(commodity[i])
                }
            } else {
                $("#SelectAllBox").prop("checked", false);
                $("#commodity_In").find("input").prop("checked", false);
                agin = false;
                cont = 0
                $("#number_com").text(cont)
                commodity_ch_List = [];
            }
            addCommodity(commodity_ch_List);
        })
        // 选择时已选数字跟着变化
        let numCont = 0
        for (let i = 0; i < $("#commodity_In").find("input").length; i++) {
            $("#commodity_In").find("input").eq(i).click(function () {
                if ($("#commodity_In").find("input").eq(i).prop("checked") == true) {
                    numCont++
                    $("#number_com").text(numCont)
                    commodity_ch_List.push(commodity[i])
                }
                if ($("#commodity_In").find("input").eq(i).prop("checked") == false) {
                    numCont--
                    $("#number_com").text(numCont)
                    commodity_ch_List.splice(i, 1)
                }
            })
        }
        addCommodity(commodity_ch_List);
    }
    choose()

    //渲染数据
    function look_com(data) {
        $("#commodity_choose").html("");
        for (let i = 0; i < data.length; i++) {
            $('#commodity_choose').append(`<tr>
                <td>${data[i].ProductIn}</td>
                <td>${data[i].Price}</td>
                <td><span style="color:#0dcaf0" id="del_choose">删除</span></td>
            </tr>`)
        }
    }
    // 点击保存和取消
    function addCommodity(data) {
        // 渲染数据
        $(".button_box").children().eq(0).click(function () {
            look_com(data)
            $(".modalItem").hide()
        })

        $(".button_box").children().eq(1).click(function () {
            $(".modalItem").hide()
        })
    }

    // 点击选择货品中删除，删除该信息
    function delChoose() {
        $("#commodity_choose").on("click", "#del_choose", function () {
            let aa = $(this).parents("tr").children().eq(0).text();
            // console.log(aa);
            // console.log(commodity_ch_List);
            for (let i = 0; i < commodity_ch_List.length; i++) {
                if (commodity_ch_List[i].ProductIn == aa) {
                    commodity_ch_List.splice(i, 1)
                }
            }
            look_com(commodity_ch_List)
        })
    }
    delChoose()
})